<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    //创建对象
    let weather = {
        city : "Huangshan",
        temp : "16℃~22℃",
        date : "2088-08-08",
        humidity : "98%"
    };

    //将天气转换为JSON字符串
    let str = JSON.stringify(weather);
    document.write(str+"<br>");

    //将JSON解析
    let weather2 = JSON.parse(str);
    document.write(weather2.city  + "<br>");
    document.write(weather2.temp  + "<br>");
    document.write(weather2.date  + "<br>");
    document.write(weather2.humidity  + "<br>");


</script>
</html>